<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <title>酒店预定管理系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 引入 Layui CSS -->
    <link href="/layui/css/layui.css" rel="stylesheet">
</head>

<body>
<div class="layui-layout layui-layout-admin">
    <!-- 头部 -->
    <script>
        var value = sessionStorage.getItem("admin");
        if (value ===null){
            alert("请先登录!")
            window.location.href = "../login/login.html"
        }
    </script>
    <div class="layui-header" style="background-color: #c0c4cc">
        <div class="layui-logo layui-hide-xs layui-bg-black">酒店预定管理系统</div>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item layui-hide layui-show-sm-inline-block">
                <a href="javascript:;">
                    <img src="//unpkg.com/outeres@0.0.10/img/layui/icon-v2.png" class="layui-nav-img">
                    <span id="head_user"></span>
                    <script>
                        var value = sessionStorage.getItem("name");
                        document.getElementById("head_user").textContent=value
                    </script>
                </a>
            </li>
        </ul>
    </div>
    <!-- 侧边栏 -->
    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll" style="background-color:sandybrown;">
            <ul class="layui-nav layui-nav-tree" lay-filter="test" style="background-color:sandybrown">
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">个人信息管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="person_information.html">个人信息</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">酒店订单管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="OrderList.html">预定房间订单</a></dd>
                        <dd><a href="checkinList.html">已入住房间订单</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">客房信息管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="guestroom_list.html">客房列表</a></dd>
                        <dd><a href="roomType.html">房间类型</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">酒店活动管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="activity.html">活动管理</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">会员管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="member_management.html">会员列表</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>
    <!-- 主体内容 -->
    <div class="layui-body">
        <div style="padding: 15px;">
            <blockquote class="layui-elem-quote layui-text">
                    <span class="layui-breadcrumb">
                        <a href="index.html">首页</a>
                        <a><cite>酒店订单管理</cite></a>
                        <a><cite>已入住房间订单</cite></a>
                    </span>
            </blockquote>
            <div class="layui-card-body">
                <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
                    <legend>已入住房间订单</legend>
                </fieldset>
                <table id="historyOrderTable" class="layui-table"></table>
            </div>
        </div>
    </div>
    <!-- 底部 -->
    <div class="layui-footer">
        酒店预定管理系统
    </div>
</div>

<!-- 引入 Layui JavaScript -->
<script src="jquery/jquery-3.6.0.js"></script>
<script src="//unpkg.com/layui@2.9.21/dist/layui.js"></script>
<script>
    layui.use(['element', 'layer', 'util', 'table'], function () {
        var element = layui.element;
        var layer = layui.layer;
        var util = layui.util;
        var table = layui.table;

        // 渲染表格
        table.render({
            elem: '#historyOrderTable',
            url: '/historyOrder/selectAll', // 数据接口，假设为历史订单的数据接口
            method: 'get', // 修改为 GET 方法
            cols: [[
                {title:'编号', width:250, templet: function(res){
                        return '<em>'+ res.history_id +'</em>'
                    }},
                {title:'管理员id', width:250,  templet: function(res){
                        return '<em>'+ res.admin_id +'</em>'
                    }},
                {title:'退房时间', width:250, templet: function(res){
                        return '<em>'+ res.check_out_time +'</em>'
                    }},
                {title:'订单id', width:250, templet: function(res){
                        return '<em>'+ res.reservation_id +'</em>'}}
            ]]
            });
        });
</script>
</body>

</html>